/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.ipti.br.tag.bean;

import static com.sun.org.apache.xalan.internal.lib.ExsltDatetime.time;
import org.ipti.br.tag.entity.*;
import org.ipti.br.tag.entity.enums.Laterality;
import org.ipti.br.tag.entity.enums.MaritalStatus;
import org.ipti.br.tag.entity.enums.Sex;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import javax.inject.Inject;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;
import javax.faces.model.SelectItem;
import org.ipti.br.tag.bean.lazy.LazyHumanDataModel;
import org.ipti.br.tag.bo.ActorBO;
import org.ipti.br.tag.bo.AddInfoPersonageBO;
import org.ipti.br.tag.bo.AdditionalInfoBO;
import org.ipti.br.tag.bo.AdditionalInfoTypeBO;
import org.ipti.br.tag.bo.AddressBO;
import org.ipti.br.tag.bo.EthnicityBO;
import org.ipti.br.tag.bo.HumanBO;
import org.ipti.br.tag.bo.LoginBO;
import org.ipti.br.tag.bo.NationalityBO;
import org.ipti.br.tag.bo.NeighborhoodBO;
import org.ipti.br.tag.bo.PersonageBO;
import org.ipti.br.tag.bo.StreetBO;
import org.ipti.br.tag.bo.UnityBO;
import org.ipti.br.tag.bo.ZipcodeBO;
import static org.ipti.br.tag.entity.AdditionalInfo_.additionalInfoType;
import org.ipti.br.tag.util.CalendarUtil;
import org.ipti.br.tag.util.EncryptionUtil;
import org.ipti.br.tag.util.LoginUtil;

/**
 *
 * @author root
 */
@ManagedBean(name = "actorRegistration")
@ViewScoped
public class ActorRegistrationBean extends AppBaseBean {

    @Inject
    private ActorBO actorBO;
    @Inject
    private AdditionalInfoBO additionalInfoBO;
    @Inject
    private AdditionalInfoTypeBO additionalInfoTypeBO;
    @Inject
    private AddInfoPersonageBO addInfoPersonageBO;
    @Inject
    private AddressBO addressBO;
    @Inject
    private EthnicityBO ethnicityBO;
    @Inject
    private HumanBO humanBO;
    @Inject
    private LoginBO loginBO;
    @Inject
    private NationalityBO nationalityBO;
    @Inject
    private PersonageBO personageBO;
    @Inject
    private UnityBO unityBO;
    @Inject
    private NeighborhoodBO neighborhoodBO;
    @Inject
    private StreetBO streetBO;
    @Inject
    private ZipcodeBO zipcodeBO;
    @Inject
    private SessionBean sessionBean;
    private Actor actor;
    private Address address;
    private Human human;
    private Human genericHuman;
    private Human humanFather;
    private Human humanMother;
    private Human humanSponsor;
    private Login login;
    private Zipcode zipcode;
    private Long ethnicityID;
    private Long nationalityID;
    private Long personageID;
    private Long unityForRegisterID;
    private String neighborhood;
    private String cep;
    private String street;
    private boolean showAddress;
    private Calendar birthday;
    private List<AdditionalInfo> additionalInfoList;
    private LazyHumanDataModel humanList;
    private List<SelectItem> ethnicityList;
    private List<SelectItem> maritalStatusList;
    private List<SelectItem> nationalityList;
    private List<SelectItem> neighborhoodList;
    private List<SelectItem> lateralityList;
    private List<SelectItem> sexList;
    private List<SelectItem> unitiesForRegister;
    //dados de cadastro de humano
    private String mask;
    private Address addressRegister;
    private Human humanRegister;
    private Zipcode zipcodeRegister;
    private String cepRegister;
    private String neighborhoodRegister;
    private String streetRegister;
    private String additionalInfoRegister;
    private Long ethnicityIDRegister;
    private Long nationalityIDRegister;
    private Long addInfoTypeIDRegister;
    private boolean showAddressRegister;
    private List<SelectItem> additionalInfoTypeListRegister;
    private List<SelectItem> sexListRegister;

    public ActorRegistrationBean() {
    }

    //==========================================================================
    public void prepareNewMale() {
        initializeHuman();
        sexListRegister = new ArrayList<SelectItem>();
        sexListRegister.add(new SelectItem(Sex.MALE, "Masculino"));

    }

    public void prepareNewFemale() {
        initializeHuman();
        sexListRegister = new ArrayList<SelectItem>();
        sexListRegister.add(new SelectItem(Sex.FEMALE, "Feminino"));
    }

    public void prepareNewHuman() {
        initializeHuman();
        sexListRegister = new ArrayList<SelectItem>();
        sexListRegister.add(new SelectItem(Sex.MALE, "Feminino"));
        sexListRegister.add(new SelectItem(Sex.MALE, "Masculino"));
    }

    public boolean validateZipcodeRegister() {
        if (zipcodeRegister != null) {
            return true;
        } else {
            return false;
        }
    }

    public void createNewHuman() {
        try {
            if (validateZipcodeRegister()) {
                Ethnicity ethnicity = new Ethnicity();
                ethnicity.setId(ethnicityIDRegister);
                humanRegister.setEthnicity(ethnicity);
                Nationality nationality = new Nationality();
                nationality.setId(nationalityIDRegister);
                humanRegister.setNationality(nationality);

                addressRegister.setZipcode(zipcodeRegister);
                Neighborhood neighborhoodAux = neighborhoodBO.searchByNameCity(neighborhoodRegister, zipcodeRegister.getCity().getId());
                Street streetAux = streetBO.searchByNameCity(streetRegister, zipcodeRegister.getCity().getId());

                if (neighborhoodAux == null) {
                    neighborhoodAux = new Neighborhood(neighborhoodRegister, zipcodeRegister.getCity());
                    neighborhoodBO.create(neighborhoodAux);
                }
                if (streetAux == null) {
                    streetAux = new Street(streetRegister, zipcodeRegister.getCity());
                    streetBO.create(streetAux);
                }

                addressRegister.setNeighborhood(neighborhoodAux);
                addressRegister.setStreet(streetAux);

                Long addressID = addressBO.searchExactAddress(addressRegister);

                if (addressID == null || addressID.equals(0L)) {
                    addressBO.create(addressRegister);
                } else {
                    addressRegister.setId(addressID);
                }

                humanRegister.setAddress(addressRegister);
                humanBO.getHumanDAO().syncCreate(humanRegister);

                if (addInfoTypeIDRegister != 0L) {
                    AdditionalInfoType ait = new AdditionalInfoType();
                    ait.setId(addInfoTypeIDRegister);

                    AdditionalInfo ai = new AdditionalInfo();
                    ai.setValue(additionalInfoRegister);
                    ai.setPerson(humanRegister);
                    ai.setAdditionalInfoType(ait);
                    additionalInfoBO.create(ai);
                }

                if (sexListRegister.size() < 2) {
                    if (humanRegister.getSex() == Sex.MALE) {
                        //System.out.println("Cadastrando pai");
                        humanFather = humanRegister;
                    } else {
                        //System.out.println("Cadastrando mãe");
                        humanMother = humanRegister;
                    }
                } else {
                    //System.out.println("Cadastrando sponsor");
                    humanSponsor = humanRegister;
                }
                initializeHuman();
            }
        } catch (Exception ex) {
        }
    }

    public void initializeHuman() {
        addressRegister = new Address();
        humanRegister = new Human();
        humanRegister.setBirthday(Calendar.getInstance());
        neighborhoodRegister = "";
        streetRegister = "";
        cepRegister = "";
        zipcodeRegister = null;

        showAddressRegister = false;

        loadAddInfoTypeList();
        additionalInfoRegister = "";
        addInfoTypeIDRegister = null;
    }

    public void searchCEPRegister() {
        neighborhoodRegister = "";
        streetRegister = "";
        zipcodeRegister = zipcodeBO.searchByCode(Integer.parseInt(cepRegister));
        if (zipcodeRegister == null) {
            showAddressRegister = false;
            addInfoMessage("addHumanForm:addHumanView", "CEP não cadastrado.", null);
        } else {
            if (zipcodeRegister.getNeighborhood() != null) {
                neighborhoodRegister = zipcodeRegister.getNeighborhood().getName();
            }
            if (zipcodeRegister.getStreet() != null) {
                streetRegister = zipcodeRegister.getStreet().getName();
            }
            showAddressRegister = true;
        }
    }

    public List<String> neighborhoodCompleteRegister(String query) {
        return neighborhoodBO.neighborhoodList(query, zipcodeRegister.getCity());
    }

    public List<String> streetCompleteRegister(String query) {
        return streetBO.streetList(query, zipcodeRegister.getCity());
    }

    public void loadAddInfoTypeList() {
        additionalInfoTypeListRegister = new ArrayList<SelectItem>();
        additionalInfoTypeListRegister.add(new SelectItem(0L, "Selecione um tipo"));
        for (AdditionalInfoType ait : addInfoPersonageBO.findAddInfoTypeWithPersonage()) {
            additionalInfoTypeListRegister.add(new SelectItem(ait.getId(), ait.getAcronym()));
        }
    }

    public void loadMask(Long aditID) {
        if (aditID == 0) {
            mask = null;
        } else {
            mask = additionalInfoTypeBO.find(aditID).getMask();
        }
    }
    //==========================================================================

    public void searchCEP() {
        neighborhood = "";
        street = "";
        zipcode = zipcodeBO.searchByCode(Integer.parseInt(cep));
        if (zipcode == null) {
            showAddress = false;
            addInfoMessage("actorRegistrationForm:filiationTabView:cep", "CEP não cadastrado.", null);
        } else {
            if (zipcode.getNeighborhood() != null) {
                neighborhood = zipcode.getNeighborhood().getName();
            }
            if (zipcode.getStreet() != null) {
                street = zipcode.getStreet().getName();
            }
            showAddress = true;
        }
    }

    public List<String> neighborhoodComplete(String query) {
        return neighborhoodBO.neighborhoodList(query, zipcode.getCity());
    }

    public List<String> streetComplete(String query) {
        return streetBO.streetList(query, zipcode.getCity());
    }

    public String getPersonageName() {
        return personageBO.find(personageID).getName();
    }

    public void initialize() {
        humanFather = null;
        humanMother = null;
        humanSponsor = null;

        humanList = new LazyHumanDataModel(humanBO.getHumanDAO(), null);

        zipcode = null;
        neighborhood = "";
        street = "";
        cep = "";
        showAddress = false;
        actor = new Actor();
        address = new Address();
        human = new Human();
        human.setBirthday(Calendar.getInstance());
        login = new Login();
        loadUnitiesForRegister();
        loadAddInfoList();
        loadEthnicityList();
        loadLateralityList();
        loadMaritalStatusList();
        loadNationalityList();
        loadSexList(); 
        
        
    }

    public void prepareFatherSearch() {
        humanList = new LazyHumanDataModel(humanBO.getHumanDAO(), Sex.MALE);
        genericHuman = null;
    }

    public void prepareMotherSearch() {
        humanList = new LazyHumanDataModel(humanBO.getHumanDAO(), Sex.FEMALE);
        genericHuman = null;
    }

    public void prepareSponsorSearch() {
        humanList = new LazyHumanDataModel(humanBO.getHumanDAO(), null);
        genericHuman = null;
    }

    public void configureFatherMotherSponsor() {
        if (genericHuman != null) {
            if (humanList.getSex() == null) {
                humanSponsor = genericHuman;
            } else if (humanList.getSex() == Sex.MALE) {
                humanFather = genericHuman;
            } else {
                humanMother = genericHuman;
            }
            genericHuman = null;
        }
    }

    public void save() {
        try {
            try {
                if (validateParents()) {
                    if (humanFather != null && humanFather.getId() != 0L && humanFather.getId() != null) {
                        human.setFather(humanFather);
                    } else {
                        human.setFather(null);
                    }

                    if (humanMother != null && humanMother.getId() != 0L && humanMother.getId() != null) {
                        human.setMother(humanMother);
                    } else {
                        human.setMother(null);
                    }
                    if (humanSponsor != null && humanSponsor.getId() != 0L && humanSponsor.getId() != null) {
                        human.setSponsor(humanSponsor);
                    } else {
                        human.setSponsor(null);
                    }
                } else {
                    throw new Exception("É necessário cadastrar os Pais ou Responsável");
                }
            } catch (Exception e) {
                addErrorMessage("actorRegistrationForm:filiationTabView", e.getMessage(), null);
                return;
            }

            if (validateBirthday() & validateZipcode()) {
                Personage p = personageBO.find(personageID);
                //if (p != null) {
                try {
                    Unity u = unityBO.find(unityForRegisterID);
                    actor.setPersonage(p);
                    actor.setActivated(u.getActivated());
                    actor.setDeactivated(u.getDeactivated());
                    actor.setUnity(u);
                } catch (Exception ex) {
                    addErrorMessage("actorRegistrationForm:filiationTabView", "Erro: Personagem não encontrado", null);
                }

                address.setZipcode(zipcode);
                Neighborhood neighborhoodAux = neighborhoodBO.searchByNameCity(neighborhood, zipcode.getCity().getId());
                Street streetAux = streetBO.searchByNameCity(street, zipcode.getCity().getId());

                if (neighborhoodAux == null) {
                    neighborhoodAux = new Neighborhood(neighborhood, zipcode.getCity());
                    neighborhoodBO.create(neighborhoodAux);
                }
                if (streetAux == null) {
                    streetAux = new Street(street, zipcode.getCity());
                    streetBO.create(streetAux);
                }

                address.setNeighborhood(neighborhoodAux);
                address.setStreet(streetAux);

                Long addressID = addressBO.searchExactAddress(address);

                if (addressID == null || addressID.equals(0L)) {
                    addressBO.create(address);
                } else {
                    address.setId(addressID);
                }

                human.setAddress(address);

            }
            else{
                return;
            }
            Ethnicity ethnicity = new Ethnicity();
            ethnicity.setId(ethnicityID);
            human.setEthnicity(ethnicity);
            Nationality nationality = new Nationality();
            nationality.setId(nationalityID);
            human.setNationality(nationality);
            human.setAdditionalInfos(additionalInfoList);

            for (AdditionalInfo additionalInfo : additionalInfoList) {
                additionalInfo.setPerson(human);
            }

            humanBO.create(human);

            actor.setPerson(human);
            actorBO.create(actor);

            String userName = "";
            int precedence = Integer.MAX_VALUE;
            for (AdditionalInfo addInfo : additionalInfoList) {
                if (addInfo.getAdditionalInfoType().getPrecedence() < precedence) {
                    userName = addInfo.getValue();
                    precedence = addInfo.getAdditionalInfoType().getPrecedence();
                }
            }

            login.setPerson(human);
            login.setUserName(LoginUtil.selectNumbersLetters(userName));
            if (login.getUserName().isEmpty()) {
                login.setUserName(null);
            }
            login.setPassword(EncryptionUtil.encrypt(LoginUtil.passwordGenerator(CalendarUtil.getFormatedDate(human.getBirthday()))));
            loginBO.create(login);

            addInfoMessage("actorRegistrationForm:filiationTabView", "Cadastro realizado com sucesso.", null);
            initialize();

        } catch (Exception ex) {
            addErrorMessage("actorRegistrationForm:filiationTabView", "Erro: Tente novamente mais tarde ou consulte o administrador", null);
        }
    }

    public boolean validateParents() {
        if (humanFather != null || humanMother != null || humanSponsor != null) {
            return true;
        } else {
            return false;
        }
    }

    public boolean validateZipcode() {
        if (zipcode != null) {
            return true;
        } else {
            addErrorMessage("actorRegistrationForm:filiationTabView", "'Endereço' é obrigatório", null);
            return false;
        }
    }

    public boolean validateBirthday() {
        if (human.getBirthday() != Calendar.getInstance() && human.getBirthday().before(Calendar.getInstance())) {
            return true;
        } else {
            addErrorMessage("actorRegistrationForm:filiationTabView:birthday", "Nascimento deve ser anterior à data atual", null);
            return false;
        }
    }
//    
//    public Date validateBirthdayTimeNull(){
//    if (human.getBirthday() != null){
//        return human.getBirthday().getTime();
//    }
//        return null;
//}

    public void loadAddInfoList() {
        additionalInfoList = new ArrayList<AdditionalInfo>();
        for (AdditionalInfoType ait : additionalInfoTypeBO.findAddInfoTypesPerPersonage(personageBO.find(personageID))) {
            AdditionalInfo ai = new AdditionalInfo();
            ai.setAdditionalInfoType(ait);
            additionalInfoList.add(ai);
        }
    }

    public void loadEthnicityList() {
        ethnicityList = new ArrayList<SelectItem>();
        for (Ethnicity e : ethnicityBO.findAllOrder()) {
            ethnicityList.add(new SelectItem(e.getId(), e.getName()));
        }
    }

    public void loadLateralityList() {
        lateralityList = new ArrayList<SelectItem>();
        lateralityList.add(new SelectItem(Laterality.RightHanded, "Destro"));
        lateralityList.add(new SelectItem(Laterality.LeftHanded, "Canhoto"));
        lateralityList.add(new SelectItem(Laterality.Ambidextrous, "Ambidestro"));
    }

    public void loadMaritalStatusList() {
        maritalStatusList = new ArrayList<SelectItem>();
        maritalStatusList.add(new SelectItem(MaritalStatus.Single, "Solteiro"));
        maritalStatusList.add(new SelectItem(MaritalStatus.Married, "Casado"));
        maritalStatusList.add(new SelectItem(MaritalStatus.Divorced, "Divorciado"));
        maritalStatusList.add(new SelectItem(MaritalStatus.Widowed, "Viúvo"));
    }

    public void loadNationalityList() {
        nationalityList = new ArrayList<SelectItem>();
        for (Nationality n : nationalityBO.findAllOrder()) {
            nationalityList.add(new SelectItem(n.getId(), n.getPatronym()));
        }
    }

    public void loadSexList() {
        sexList = new ArrayList<SelectItem>();
        sexList.add(new SelectItem(Sex.FEMALE, "Feminino"));
        sexList.add(new SelectItem(Sex.MALE, "Masculino"));
    }

    public List<AdditionalInfo> personAdditionalInfo(Long personID) {
        return additionalInfoBO.findAddInfosPerPerson(personID);
    }

    public void loadUnitiesForRegister() {
        unitiesForRegister = new ArrayList<SelectItem>();
        unitiesForRegister.add(new SelectItem(null, "Selecione um local"));
        for (Unity u : unityBO.unityChildrenPerOrganization(sessionBean.getLoggedActor().getUnity(),
                personageBO.find(personageID).getOrganization())) {
            unitiesForRegister.add(new SelectItem(u.getId(), u.getName()));
        }
        if (unitiesForRegister.size() == 2) {
            unityForRegisterID = (Long) unitiesForRegister.get(1).getValue();
        }

    }

    public List<String> searchHumanNames(String query) {
        return humanBO.getHumanDAO().searchHumanNames(query, 10, null);
    }

    public List<Human> searchHuman(String query) {
        return humanBO.searchHumanPerName(query, 10);
    }

    public Actor getActor() {
        return actor;
    }

    public void setActor(Actor actor) {
        this.actor = actor;
    }

    public List<AdditionalInfo> getAdditionalInfoList() {
        return additionalInfoList;
    }

    public void setAdditionalInfoList(List<AdditionalInfo> additionalInfoList) {
        this.additionalInfoList = additionalInfoList;
    }

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    public String getCep() {
        return cep;
    }

    public void setCep(String cep) {
        this.cep = cep;
    }

    public Long getEthnicityID() {
        return ethnicityID;
    }

    public void setEthnicityID(Long ethnicityID) {
        this.ethnicityID = ethnicityID;
    }

    public List<SelectItem> getEthnicityList() {
        return ethnicityList;
    }

    public void setEthnicityList(List<SelectItem> ethnicityList) {
        this.ethnicityList = ethnicityList;
    }

    public Human getHuman() {
        return human;
    }

    public void setHuman(Human human) {
        this.human = human;
    }

    public Human getHumanFather() {
        return humanFather;
    }

    public void setHumanFather(Human humanFather) {
        this.humanFather = humanFather;
    }

    public Human getHumanMother() {
        return humanMother;
    }

    public void setHumanMother(Human humanMother) {
        this.humanMother = humanMother;
    }

    public Human getHumanSponsor() {
        return humanSponsor;
    }

    public void setHumanSponsor(Human humanSponsor) {
        this.humanSponsor = humanSponsor;
    }

    public List<SelectItem> getLateralityList() {
        return lateralityList;
    }

    public void setLateralityList(List<SelectItem> lateralityList) {
        this.lateralityList = lateralityList;
    }

    public Login getLogin() {
        return login;
    }

    public void setLogin(Login login) {
        this.login = login;
    }

    public List<SelectItem> getMaritalStatusList() {
        return maritalStatusList;
    }

    public void setMaritalStatusList(List<SelectItem> maritalStatusList) {
        this.maritalStatusList = maritalStatusList;
    }

    public Long getNationalityID() {
        return nationalityID;
    }

    public void setNationalityID(Long nationalityID) {
        this.nationalityID = nationalityID;
    }

    public List<SelectItem> getNationalityList() {
        return nationalityList;
    }

    public void setNationalityList(List<SelectItem> nationalityList) {
        this.nationalityList = nationalityList;
    }

    public String getNeighborhood() {
        return neighborhood;
    }

    public void setNeighborhood(String neighborhood) {
        this.neighborhood = neighborhood;
    }

    public List<SelectItem> getNeighborhoodList() {
        return neighborhoodList;
    }

    public void setNeighborhoodList(List<SelectItem> neighborhoodList) {
        this.neighborhoodList = neighborhoodList;
    }

    public Long getPersonageID() {
        return personageID;
    }

    public void setPersonageID(Long personageID) {
        this.personageID = personageID;
    }

    public List<SelectItem> getSexList() {
        return sexList;
    }

    public void setSexList(List<SelectItem> sexList) {
        this.sexList = sexList;
    }

    public boolean isShowAddress() {
        return showAddress;
    }

    public void setShowAddress(boolean showAddress) {
        this.showAddress = showAddress;
    }

    public String getStreet() {
        return street;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public List<SelectItem> getUnitiesForRegister() {
        return unitiesForRegister;
    }

    public void setUnitiesForRegister(List<SelectItem> unitiesForRegister) {
        this.unitiesForRegister = unitiesForRegister;
    }

    public Long getUnityForRegisterID() {
        return unityForRegisterID;
    }

    public void setUnityForRegisterID(Long unityForRegisterID) {
        this.unityForRegisterID = unityForRegisterID;
    }

    public Zipcode getZipcode() {
        return zipcode;
    }

    public void setZipcode(Zipcode zipcode) {
        this.zipcode = zipcode;
    }

    public SessionBean getSessionBean() {
        return sessionBean;
    }

    public void setSessionBean(SessionBean sessionBean) {
        this.sessionBean = sessionBean;
    }

    public LazyHumanDataModel getHumanList() {
        return humanList;
    }

    public void setHumanList(LazyHumanDataModel humanList) {
        this.humanList = humanList;
    }

    public Human getGenericHuman() {
        return genericHuman;
    }

    public void setGenericHuman(Human genericHuman) {
        this.genericHuman = genericHuman;
    }

    //get and set for add new human
    public Long getAddInfoTypeIDRegister() {
        return addInfoTypeIDRegister;
    }

    public void setAddInfoTypeIDRegister(Long addInfoTypeIDRegister) {
        this.addInfoTypeIDRegister = addInfoTypeIDRegister;
    }

    public String getAdditionalInfoRegister() {
        return additionalInfoRegister;
    }

    public void setAdditionalInfoRegister(String additionalInfoRegister) {
        this.additionalInfoRegister = additionalInfoRegister;
    }

    public Address getAddressRegister() {
        return addressRegister;
    }

    public void setAddressRegister(Address addressRegister) {
        this.addressRegister = addressRegister;
    }

    public String getCepRegister() {
        return cepRegister;
    }

    public void setCepRegister(String cepRegister) {
        this.cepRegister = cepRegister;
    }

    public Long getEthnicityIDRegister() {
        return ethnicityIDRegister;
    }

    public void setEthnicityIDRegister(Long ethnicityIDRegister) {
        this.ethnicityIDRegister = ethnicityIDRegister;
    }

    public Human getHumanRegister() {
        return humanRegister;
    }

    public void setHumanRegister(Human humanRegister) {
        this.humanRegister = humanRegister;
    }

    public Long getNationalityIDRegister() {
        return nationalityIDRegister;
    }

    public void setNationalityIDRegister(Long nationalityIDRegister) {
        this.nationalityIDRegister = nationalityIDRegister;
    }

    public String getNeighborhoodRegister() {
        return neighborhoodRegister;
    }

    public void setNeighborhoodRegister(String neighborhoodRegister) {
        this.neighborhoodRegister = neighborhoodRegister;
    }

    public List<SelectItem> getSexListRegister() {
        return sexListRegister;
    }

    public void setSexListRegister(List<SelectItem> sexListRegister) {
        this.sexListRegister = sexListRegister;
    }

    public boolean isShowAddressRegister() {
        return showAddressRegister;
    }

    public void setShowAddressRegister(boolean showAddressRegister) {
        this.showAddressRegister = showAddressRegister;
    }

    public String getStreetRegister() {
        return streetRegister;
    }

    public void setStreetRegister(String streetRegister) {
        this.streetRegister = streetRegister;
    }

    public Zipcode getZipcodeRegister() {
        return zipcodeRegister;
    }

    public void setZipcodeRegister(Zipcode zipcodeRegister) {
        this.zipcodeRegister = zipcodeRegister;
    }

    public List<SelectItem> getAdditionalInfoTypeListRegister() {
        return additionalInfoTypeListRegister;
    }

    public void setAdditionalInfoTypeListRegister(List<SelectItem> additionalInfoTypeListRegister) {
        this.additionalInfoTypeListRegister = additionalInfoTypeListRegister;
    }

    public String getMask() {
        return mask;
    }

    public void setMask(String mask) {
        this.mask = mask;
    }
}
